3.709 \(\int \frac{(A+B \tan (e+f x)) (c-i c \tan (e+f x))}{a+i a \tan (e+f x)} \, dx\)

Optimal. Leaf size=57 \[ -\frac{c (A+i B)}{a f (-\tan (e+f x)+i)}+\frac{B c \log (\cos (e+f x))}{a f}-\frac{i B c x}{a} \]

[Out]

((-I)*B*c*x)/a + (B*c*Log[Cos[e + f*x]])/(a*f) - ((A + I*B)*c)/(a*f*(I - Tan[e + f*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.090516, antiderivative size = 57, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 39, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.051, Rules used = {3588, 43} \[ -\frac{c (A+i B)}{a f (-\tan (e+f x)+i)}+\frac{B c \log (\cos (e+f x))}{a f}-\frac{i B c x}{a} \]

Antiderivative was successfully verified.

[In]

Int[((A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x]))/(a + I*a*Tan[e + f*x]),x]

[Out]

((-I)*B*c*x)/a + (B*c*Log[Cos[e + f*x]])/(a*f) - ((A + I*B)*c)/(a*f*(I - Tan[e + f*x]))

Rule 3588

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(a*c)/f, Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rubi steps

\begin{align*} \int \frac{(A+B \tan (e+f x)) (c-i c \tan (e+f x))}{a+i a \tan (e+f x)} \, dx &=\frac{(a c) \operatorname{Subst}\left (\int \frac{A+B x}{(a+i a x)^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{(a c) \operatorname{Subst}\left (\int \left (\frac{-A-i B}{a^2 (-i+x)^2}-\frac{B}{a^2 (-i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac{i B c x}{a}+\frac{B c \log (\cos (e+f x))}{a f}-\frac{(A+i B) c}{a f (i-\tan (e+f x))}\\ \end{align*}

Mathematica [B]  time = 1.39471, size = 124, normalized size = 2.18 \[ \frac{c \cos (e+f x) (A+B \tan (e+f x)) \left (\tan (e+f x) \left (-i A+B \log \left (\cos ^2(e+f x)\right )+B\right )+A-2 i B \tan ^{-1}(\tan (f x)) (\tan (e+f x)-i)-i B \log \left (\cos ^2(e+f x)\right )+i B\right )}{2 a f (\tan (e+f x)-i) (A \cos (e+f x)+B \sin (e+f x))} \]

Antiderivative was successfully verified.

[In]

Integrate[((A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x]))/(a + I*a*Tan[e + f*x]),x]

[Out]

(c*Cos[e + f*x]*(A + B*Tan[e + f*x])*(A + I*B - I*B*Log[Cos[e + f*x]^2] + ((-I)*A + B + B*Log[Cos[e + f*x]^2])
*Tan[e + f*x] - (2*I)*B*ArcTan[Tan[f*x]]*(-I + Tan[e + f*x])))/(2*a*f*(A*Cos[e + f*x] + B*Sin[e + f*x])*(-I +
Tan[e + f*x]))

________________________________________________________________________________________

Maple [A]  time = 0.042, size = 64, normalized size = 1.1 \begin{align*}{\frac{iBc}{af \left ( \tan \left ( fx+e \right ) -i \right ) }}+{\frac{Ac}{af \left ( \tan \left ( fx+e \right ) -i \right ) }}-{\frac{Bc\ln \left ( \tan \left ( fx+e \right ) -i \right ) }{af}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))/(a+I*a*tan(f*x+e)),x)

[Out]

I/f*c/a/(tan(f*x+e)-I)*B+1/f*c/a/(tan(f*x+e)-I)*A-1/f*c/a*B*ln(tan(f*x+e)-I)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))/(a+I*a*tan(f*x+e)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 1.72784, size = 186, normalized size = 3.26 \begin{align*} \frac{{\left (-4 i \, B c f x e^{\left (2 i \, f x + 2 i \, e\right )} + 2 \, B c e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) +{\left (i \, A - B\right )} c\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{2 \, a f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))/(a+I*a*tan(f*x+e)),x, algorithm="fricas")

[Out]

1/2*(-4*I*B*c*f*x*e^(2*I*f*x + 2*I*e) + 2*B*c*e^(2*I*f*x + 2*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) + (I*A - B)*c)*
e^(-2*I*f*x - 2*I*e)/(a*f)

________________________________________________________________________________________

Sympy [A]  time = 1.4868, size = 114, normalized size = 2. \begin{align*} - \frac{2 i B c x}{a} + \frac{B c \log{\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a f} + \begin{cases} \frac{\left (i A c - B c\right ) e^{- 2 i e} e^{- 2 i f x}}{2 a f} & \text{for}\: 2 a f e^{2 i e} \neq 0 \\x \left (\frac{2 i B c}{a} + \frac{\left (A c - 2 i B c e^{2 i e} + i B c\right ) e^{- 2 i e}}{a}\right ) & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))/(a+I*a*tan(f*x+e)),x)

[Out]

-2*I*B*c*x/a + B*c*log(exp(2*I*f*x) + exp(-2*I*e))/(a*f) + Piecewise(((I*A*c - B*c)*exp(-2*I*e)*exp(-2*I*f*x)/
(2*a*f), Ne(2*a*f*exp(2*I*e), 0)), (x*(2*I*B*c/a + (A*c - 2*I*B*c*exp(2*I*e) + I*B*c)*exp(-2*I*e)/a), True))

________________________________________________________________________________________

Giac [B]  time = 1.38725, size = 184, normalized size = 3.23 \begin{align*} -\frac{\frac{2 \, B c \log \left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - i\right )}{a} - \frac{B c \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1 \right |}\right )}{a} - \frac{B c \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 1 \right |}\right )}{a} - \frac{3 \, B c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 2 \, A c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 8 i \, B c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 3 \, B c}{a{\left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - i\right )}^{2}}}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))/(a+I*a*tan(f*x+e)),x, algorithm="giac")

[Out]

-(2*B*c*log(tan(1/2*f*x + 1/2*e) - I)/a - B*c*log(abs(tan(1/2*f*x + 1/2*e) + 1))/a - B*c*log(abs(tan(1/2*f*x +
 1/2*e) - 1))/a - (3*B*c*tan(1/2*f*x + 1/2*e)^2 - 2*A*c*tan(1/2*f*x + 1/2*e) - 8*I*B*c*tan(1/2*f*x + 1/2*e) -
3*B*c)/(a*(tan(1/2*f*x + 1/2*e) - I)^2))/f